public class PlayerFactory{
        public static Player createPlayer(int index, Pieces who, int pieces_num){
                switch(index){
                        case 1:
                                return (Player) new HumanPlayer("One", who, pieces_num);
                        case 2:
                                return (Player) new ComputerPlayer("Two", who, pieces_num);
                        case 3:
                                return (Player) new HumanPlayer("Three", who, pieces_num);
                        default:
                                return (Player) new HumanPlayer("Four", who, pieces_num);
                }
        }
}
